export default {
    throttle(fn, delay){
        var timer = null
        return function () {
            clearTimeout(timer)
            timer = setTimeout(fn, delay)
        }
    },
    client(){
        if (window.innerWidth) {
            return {
                width: window.innerWidth,
                height: window.innerHeight
            }
        } else if (document.compatMode === "CSS1Compat") {
            return {
                width: document.documentElement.clientWidth,
                height: document.documentElement.clientHeight
            }
        } else {
            return {
                width: document.body.clientWidth,
                height: document.body.clientHeight
            }
        }
    }
}
